package com.leyou.auth.controller;

import com.leyou.auth.service.ClientInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：qcq
 * @date ：Created in 2020/12/18 15:58
 * @description：
 */
@RestController
@RequestMapping("/client")
public class ClientController {

    @Autowired
    private ClientInfoService clientInfoService;

    @GetMapping("/key")
    public ResponseEntity<String> getSecretKey(@RequestParam("clientId") String clientId, @RequestParam("secret") String secret) {

        String secretKey = clientInfoService.getSecretKey(clientId, secret);
        return ResponseEntity.ok(secretKey);

    }
}
